package p270jp.pxv.android.uploadNovel.presentation.activity;

import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.ViewModelStore;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import p018ai.ProgressDialogFragment;
import p047bg.C1124a;
import p064c6.Preconditions;
import p080cm.Cover;
import p081cn.progressionUtil;
import p089d.C2422d;
import p089d.C2425g;
import p089d.C2426h;
import p134ei.AnalyticsAction;
import p134ei.PixivAnalytics;
import p138em.AbstractActivityC2956d;
import p138em.C2963n;
import p138em.C2964o;
import p138em.C2965p;
import p138em.C2966q;
import p138em.C2967r;
import p138em.C2968s;
import p138em.C2969t;
import p138em.View$OnClickListenerC2957g;
import p138em.View$OnClickListenerC2959i;
import p138em.View$OnClickListenerC2960j;
import p163fm.C3113b;
import p165fo.Subscribe;
import p187gl.C3370t;
import p188gm.C3386c;
import p188gm.C3419k;
import p188gm.C3420l;
import p188gm.NovelBackupAction;
import p188gm.NovelBackupActionCreator;
import p188gm.NovelBackupStore;
import p188gm.NovelUploadAction;
import p188gm.NovelUploadActionCreator;
import p188gm.NovelUploadStore;
import p189gn.AbstractC3435a;
import p189gn.AbstractC3446l;
import p215hm.TextChangedCounter;
import p216hn.DefaultConstructorMarker;
import p216hn.Lambda;
import p216hn.Reflection;
import p258jd.SingleCreate;
import p258jd.SingleFlatMap;
import p270jp.pxv.android.R;
import p270jp.pxv.android.commonObjects.model.CommentAccessType;
import p270jp.pxv.android.event.DiscardAndFinishNovelUpload;
import p270jp.pxv.android.event.DiscardNovelBackup;
import p270jp.pxv.android.event.EventNone;
import p270jp.pxv.android.event.NovelUploadSubmitPopupCancel;
import p270jp.pxv.android.event.NovelUploadSubmitPopupOK;
import p270jp.pxv.android.event.RestoreNovelBackup;
import p270jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity;
import p294ko.ViewModelOwner;
import p314lg.ActivityNovelUploadBinding;
import p325m0.MutabilityOwnership;
import p370ni.InfoType;
import p373nl.NovelUploadSettings;
import p393of.C5453b;
import p436q6.StringMerger;
import p447qi.EventPublishDialogFragment;
import p452qn.C5853d;
import p467rd.subscribers;
import p491sd.C6034a;
import p579vo.Qualifier;
import p593wc.AbstractC6902j;
import p603wm.AbstractC6949c;
import p603wm.Unit;
import p629xm.C7192p;
import p639y6.C7296l;
import p671zc.CompositeDisposable;
import p671zc.Disposable;
import p677zi.PixivImageLoader;
import p680zl.C7499c;
import p680zl.NovelIsOriginalParameter;
import p680zl.NovelPostParameter;

/* compiled from: NovelUploadActivity.kt */
/* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity */
/* loaded from: classes2.dex */
public final class NovelUploadActivity extends AbstractActivityC2956d {

    /* renamed from: a0 */
    public static final C4349a f19410a0 = new C4349a(null);

    /* renamed from: b0 */
    public static final C5853d f19411b0 = new C5853d("^[\\s\u3000]+");

    /* renamed from: c0 */
    public static final C5853d f19412c0 = new C5853d("[\\s\u3000]+");

    /* renamed from: I */
    public ActivityNovelUploadBinding f19413I;

    /* renamed from: J */
    public final AbstractC6949c f19414J = Preconditions.m9802P(3, new C4358j(this, null, null, new C4357i(this), null));

    /* renamed from: K */
    public final AbstractC6949c f19415K = Preconditions.m9802P(3, new C4360l(this, null, null, new C4359k(this), null));

    /* renamed from: L */
    public final AbstractC6949c f19416L = Preconditions.m9802P(3, new C4362n(this, null, null, new C4361m(this), null));

    /* renamed from: M */
    public final AbstractC6949c f19417M = Preconditions.m9802P(3, new C4364p(this, null, null, new C4363o(this), null));

    /* renamed from: N */
    public final AbstractC6949c f19418N = Preconditions.m9801Q(new C4365q());

    /* renamed from: O */
    public final AbstractC6949c f19419O = Preconditions.m9801Q(new C4353e());

    /* renamed from: P */
    public final AbstractC6949c f19420P = Preconditions.m9801Q(new C4351c());

    /* renamed from: Q */
    public final AbstractC6949c f19421Q = Preconditions.m9802P(1, new C4355g(this, null, null));

    /* renamed from: R */
    public final AbstractC6949c f19422R;

    /* renamed from: Y */
    public C3113b f19423Y;

    /* renamed from: Z */
    public int f19424Z;

    /* compiled from: NovelUploadActivity.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$a */
    /* loaded from: classes2.dex */
    public static final class C4349a {
        public C4349a(DefaultConstructorMarker eVar) {
        }

        /* renamed from: a */
        public static Intent m4515a(C4349a aVar, Context context, boolean z, Long l, int i) {
            if ((i & 2) != 0) {
                z = false;
            }
            if ((i & 4) != 0) {
                l = null;
            }
            MutabilityOwnership.m3745m(context, "context");
            Intent intent = new Intent(context, NovelUploadActivity.class);
            intent.putExtra("bundle_key_selected_restore_from_my_works", z);
            if (l != null) {
                intent.putExtra("bundle_key_draft_id_to_init_with", l.longValue());
            }
            return intent;
        }
    }

    /* compiled from: NovelUploadActivity.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$b */
    /* loaded from: classes2.dex */
    public /* synthetic */ class C4350b {

        /* renamed from: a */
        public static final /* synthetic */ int[] f19425a;

        static {
            int[] iArr = new int[C7499c.m40a().length];
            iArr[0] = 1;
            iArr[2] = 2;
            iArr[1] = 3;
            iArr[3] = 4;
            iArr[4] = 5;
            iArr[5] = 6;
            int[] iArr2 = new int[C2422d.m7802a().length];
            iArr2[0] = 1;
            iArr2[1] = 2;
            iArr2[2] = 3;
            int[] iArr3 = new int[CommentAccessType.values().length];
            iArr3[CommentAccessType.ALLOW.ordinal()] = 1;
            iArr3[CommentAccessType.DENY.ordinal()] = 2;
            f19425a = iArr3;
            int[] iArr4 = new int[C2426h.m7726a().length];
            iArr4[0] = 1;
            iArr4[1] = 2;
            iArr4[2] = 3;
            iArr4[3] = 4;
            int[] iArr5 = new int[C2425g.m7731a().length];
            iArr5[0] = 1;
            iArr5[2] = 2;
            iArr5[1] = 3;
        }
    }

    /* compiled from: NovelUploadActivity.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$c */
    /* loaded from: classes2.dex */
    public static final class C4351c extends Lambda implements AbstractC3435a<Integer> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4351c() {
            super(0);
            NovelUploadActivity.this = r1;
        }

        @Override // p189gn.AbstractC3435a
        public Integer invoke() {
            return Integer.valueOf(NovelUploadActivity.this.getResources().getInteger(R.integer.novel_caption_max_length_twice) / 2);
        }
    }

    /* compiled from: NovelUploadActivity.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$d */
    /* loaded from: classes2.dex */
    public static final class C4352d extends Lambda implements AbstractC3446l<Cover, Unit> {

        /* renamed from: a */
        public static final C4352d f19427a = new C4352d();

        public C4352d() {
            super(1);
        }

        @Override // p189gn.AbstractC3446l
        public Unit invoke(Cover aVar) {
            MutabilityOwnership.m3745m(aVar, "it");
            return Unit.f29503a;
        }
    }

    /* compiled from: NovelUploadActivity.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$e */
    /* loaded from: classes2.dex */
    public static final class C4353e extends Lambda implements AbstractC3435a<Integer> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4353e() {
            super(0);
            NovelUploadActivity.this = r1;
        }

        @Override // p189gn.AbstractC3435a
        public Integer invoke() {
            return Integer.valueOf(NovelUploadActivity.this.getResources().getInteger(R.integer.novel_text_max_length_twice) / 2);
        }
    }

    /* compiled from: NovelUploadActivity.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$f */
    /* loaded from: classes2.dex */
    public static final class ViewTreeObserver$OnGlobalLayoutListenerC4354f implements ViewTreeObserver.OnGlobalLayoutListener {
        public ViewTreeObserver$OnGlobalLayoutListenerC4354f() {
            NovelUploadActivity.this = r1;
        }

        @Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
        public void onGlobalLayout() {
            ActivityNovelUploadBinding r0Var = NovelUploadActivity.this.f19413I;
            if (r0Var != null) {
                r0Var.f22188Q.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                ActivityNovelUploadBinding r0Var2 = NovelUploadActivity.this.f19413I;
                if (r0Var2 != null) {
                    r0Var2.f22190q.m4591c();
                    ActivityNovelUploadBinding r0Var3 = NovelUploadActivity.this.f19413I;
                    if (r0Var3 != null) {
                        r0Var3.f22179H.m4591c();
                        ActivityNovelUploadBinding r0Var4 = NovelUploadActivity.this.f19413I;
                        if (r0Var4 != null) {
                            r0Var4.f22196w.m4591c();
                            NovelUploadActivity.this.m4521e1(CommentAccessType.ALLOW);
                            return;
                        }
                        MutabilityOwnership.m3737u("binding");
                        throw null;
                    }
                    MutabilityOwnership.m3737u("binding");
                    throw null;
                }
                MutabilityOwnership.m3737u("binding");
                throw null;
            }
            MutabilityOwnership.m3737u("binding");
            throw null;
        }
    }

    /* compiled from: ComponentCallbackExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$g */
    /* loaded from: classes2.dex */
    public static final class C4355g extends Lambda implements AbstractC3435a<NovelUploadSettings> {

        /* renamed from: a */
        public final /* synthetic */ ComponentCallbacks f19430a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4355g(ComponentCallbacks componentCallbacks, Qualifier aVar, AbstractC3435a aVar2) {
            super(0);
            this.f19430a = componentCallbacks;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [nl.a, java.lang.Object] */
        @Override // p189gn.AbstractC3435a
        public final NovelUploadSettings invoke() {
            return C1124a.m10173s(this.f19430a).f24118a.m920a().m621a(Reflection.m5499a(NovelUploadSettings.class), null, null);
        }
    }

    /* compiled from: ComponentCallbackExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$h */
    /* loaded from: classes2.dex */
    public static final class C4356h extends Lambda implements AbstractC3435a<PixivImageLoader> {

        /* renamed from: a */
        public final /* synthetic */ ComponentCallbacks f19431a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4356h(ComponentCallbacks componentCallbacks, Qualifier aVar, AbstractC3435a aVar2) {
            super(0);
            this.f19431a = componentCallbacks;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [java.lang.Object, zi.a] */
        @Override // p189gn.AbstractC3435a
        public final PixivImageLoader invoke() {
            return C1124a.m10173s(this.f19431a).f24118a.m920a().m621a(Reflection.m5499a(PixivImageLoader.class), null, null);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$i */
    /* loaded from: classes2.dex */
    public static final class C4357i extends Lambda implements AbstractC3435a<ViewModelOwner> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19432a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4357i(ComponentActivity componentActivity) {
            super(0);
            this.f19432a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelOwner invoke() {
            ComponentActivity componentActivity = this.f19432a;
            MutabilityOwnership.m3745m(componentActivity, "storeOwner");
            ViewModelStore viewModelStore = componentActivity.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "storeOwner.viewModelStore");
            return new ViewModelOwner(viewModelStore, componentActivity);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$j */
    /* loaded from: classes2.dex */
    public static final class C4358j extends Lambda implements AbstractC3435a<NovelUploadActionCreator> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19433a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f19434b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4358j(ComponentActivity componentActivity, Qualifier aVar, AbstractC3435a aVar2, AbstractC3435a aVar3, AbstractC3435a aVar4) {
            super(0);
            this.f19433a = componentActivity;
            this.f19434b = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v1, types: [androidx.lifecycle.j0, gm.h] */
        @Override // p189gn.AbstractC3435a
        public NovelUploadActionCreator invoke() {
            return progressionUtil.m9685e(this.f19433a, null, null, this.f19434b, Reflection.m5499a(NovelUploadActionCreator.class), null);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$k */
    /* loaded from: classes2.dex */
    public static final class C4359k extends Lambda implements AbstractC3435a<ViewModelOwner> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19435a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4359k(ComponentActivity componentActivity) {
            super(0);
            this.f19435a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelOwner invoke() {
            ComponentActivity componentActivity = this.f19435a;
            MutabilityOwnership.m3745m(componentActivity, "storeOwner");
            ViewModelStore viewModelStore = componentActivity.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "storeOwner.viewModelStore");
            return new ViewModelOwner(viewModelStore, componentActivity);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$l */
    /* loaded from: classes2.dex */
    public static final class C4360l extends Lambda implements AbstractC3435a<NovelUploadStore> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19436a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f19437b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4360l(ComponentActivity componentActivity, Qualifier aVar, AbstractC3435a aVar2, AbstractC3435a aVar3, AbstractC3435a aVar4) {
            super(0);
            this.f19436a = componentActivity;
            this.f19437b = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v1, types: [androidx.lifecycle.j0, gm.p] */
        @Override // p189gn.AbstractC3435a
        public NovelUploadStore invoke() {
            return progressionUtil.m9685e(this.f19436a, null, null, this.f19437b, Reflection.m5499a(NovelUploadStore.class), null);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$m */
    /* loaded from: classes2.dex */
    public static final class C4361m extends Lambda implements AbstractC3435a<ViewModelOwner> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19438a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4361m(ComponentActivity componentActivity) {
            super(0);
            this.f19438a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelOwner invoke() {
            ComponentActivity componentActivity = this.f19438a;
            MutabilityOwnership.m3745m(componentActivity, "storeOwner");
            ViewModelStore viewModelStore = componentActivity.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "storeOwner.viewModelStore");
            return new ViewModelOwner(viewModelStore, componentActivity);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$n */
    /* loaded from: classes2.dex */
    public static final class C4362n extends Lambda implements AbstractC3435a<C3386c> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19439a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f19440b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4362n(ComponentActivity componentActivity, Qualifier aVar, AbstractC3435a aVar2, AbstractC3435a aVar3, AbstractC3435a aVar4) {
            super(0);
            this.f19439a = componentActivity;
            this.f19440b = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v1, types: [androidx.lifecycle.j0, gm.c] */
        @Override // p189gn.AbstractC3435a
        public C3386c invoke() {
            return progressionUtil.m9685e(this.f19439a, null, null, this.f19440b, Reflection.m5499a(C3386c.class), null);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$o */
    /* loaded from: classes2.dex */
    public static final class C4363o extends Lambda implements AbstractC3435a<ViewModelOwner> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19441a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4363o(ComponentActivity componentActivity) {
            super(0);
            this.f19441a = componentActivity;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelOwner invoke() {
            ComponentActivity componentActivity = this.f19441a;
            MutabilityOwnership.m3745m(componentActivity, "storeOwner");
            ViewModelStore viewModelStore = componentActivity.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "storeOwner.viewModelStore");
            return new ViewModelOwner(viewModelStore, componentActivity);
        }
    }

    /* compiled from: ActivityExt.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$p */
    /* loaded from: classes2.dex */
    public static final class C4364p extends Lambda implements AbstractC3435a<NovelBackupStore> {

        /* renamed from: a */
        public final /* synthetic */ ComponentActivity f19442a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f19443b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4364p(ComponentActivity componentActivity, Qualifier aVar, AbstractC3435a aVar2, AbstractC3435a aVar3, AbstractC3435a aVar4) {
            super(0);
            this.f19442a = componentActivity;
            this.f19443b = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v1, types: [androidx.lifecycle.j0, gm.e] */
        @Override // p189gn.AbstractC3435a
        public NovelBackupStore invoke() {
            return progressionUtil.m9685e(this.f19442a, null, null, this.f19443b, Reflection.m5499a(NovelBackupStore.class), null);
        }
    }

    /* compiled from: NovelUploadActivity.kt */
    /* renamed from: jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$q */
    /* loaded from: classes2.dex */
    public static final class C4365q extends Lambda implements AbstractC3435a<Integer> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4365q() {
            super(0);
            NovelUploadActivity.this = r1;
        }

        @Override // p189gn.AbstractC3435a
        public Integer invoke() {
            return Integer.valueOf(NovelUploadActivity.this.getResources().getInteger(R.integer.novel_title_max_length_twice) / 2);
        }
    }

    public NovelUploadActivity() {
        AbstractC6949c P = Preconditions.m9802P(1, new C4356h(this, null, null));
        this.f19422R = P;
        this.f19423Y = new C3113b(C7192p.f30161a, null, (PixivImageLoader) P.getValue(), C4352d.f19427a);
    }

    /* renamed from: V0 */
    public static final String m4530V0(NovelUploadActivity novelUploadActivity, String str) {
        Objects.requireNonNull(novelUploadActivity);
        C5853d dVar = f19411b0;
        Objects.requireNonNull(dVar);
        String replaceFirst = dVar.f25492a.matcher(str).replaceFirst("");
        MutabilityOwnership.m3746l(replaceFirst, "nativePattern.matcher(in…replaceFirst(replacement)");
        String b = f19412c0.m2761b(replaceFirst, " ");
        if (b.length() <= 100) {
            return b;
        }
        String substring = b.substring(0, 100);
        MutabilityOwnership.m3746l(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
        return substring;
    }

    /* renamed from: W0 */
    public static final void m4529W0(NovelUploadActivity novelUploadActivity, String str, int i) {
        if (i == 1) {
            PixivAnalytics eVar = novelUploadActivity.f18757A;
            MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
            eVar.m6527c(3, AnalyticsAction.UPLOAD_NOVEL_FAILURE, null);
        }
        novelUploadActivity.m4527Y0();
        novelUploadActivity.m4516j1(str);
    }

    /* renamed from: X0 */
    public final NovelPostParameter m4528X0() {
        String str;
        int i;
        CommentAccessType commentAccessType;
        Long f = m4523c1().f15831p.m11091f();
        ActivityNovelUploadBinding r0Var = this.f19413I;
        if (r0Var != null) {
            Editable text = r0Var.f22186O.getText();
            String str2 = "";
            if (text == null || (str = text.toString()) == null) {
                str = str2;
            }
            String f2 = m4523c1().f15827l.m11091f();
            String str3 = f2 == null ? str2 : f2;
            String f3 = m4523c1().f15828m.m11091f();
            if (f3 != null) {
                str2 = f3;
            }
            ActivityNovelUploadBinding r0Var2 = this.f19413I;
            if (r0Var2 != null) {
                ArrayList<String> tagList = r0Var2.f22189R.getTagList();
                int i2 = this.f19423Y.f14661g;
                ActivityNovelUploadBinding r0Var3 = this.f19413I;
                if (r0Var3 != null) {
                    int checkedRadioButtonId = r0Var3.f22179H.getCheckedRadioButtonId();
                    if (checkedRadioButtonId == R.id.publicity_public_radio_button) {
                        i = 1;
                    } else if (checkedRadioButtonId == R.id.publicity_friend_radio_button) {
                        i = 3;
                    } else if (checkedRadioButtonId == R.id.publicity_private_radio_button) {
                        i = 2;
                    } else {
                        throw new IllegalStateException("デフォルトで選択されているはずのXRestrictがみ選択状態になっている");
                    }
                    ActivityNovelUploadBinding r0Var4 = this.f19413I;
                    if (r0Var4 != null) {
                        int checkedRadioButtonId2 = r0Var4.f22190q.getCheckedRadioButtonId();
                        int i3 = checkedRadioButtonId2 == R.id.radio_age_limit_all_age ? 2 : checkedRadioButtonId2 == R.id.radio_age_limit_r18 ? 3 : checkedRadioButtonId2 == R.id.radio_age_limit_r18g ? 4 : 1;
                        ActivityNovelUploadBinding r0Var5 = this.f19413I;
                        if (r0Var5 != null) {
                            NovelIsOriginalParameter aVar = new NovelIsOriginalParameter(r0Var5.f22175D.isChecked());
                            ActivityNovelUploadBinding r0Var6 = this.f19413I;
                            if (r0Var6 != null) {
                                int checkedRadioButtonId3 = r0Var6.f22196w.getCheckedRadioButtonId();
                                if (checkedRadioButtonId3 == R.id.comment_allow_radio_button) {
                                    commentAccessType = CommentAccessType.ALLOW;
                                } else if (checkedRadioButtonId3 == R.id.comment_deny_radio_button) {
                                    commentAccessType = CommentAccessType.DENY;
                                } else {
                                    commentAccessType = CommentAccessType.DENY;
                                }
                                return new NovelPostParameter(f, str, str2, i2, str3, i, i3, tagList, aVar, commentAccessType);
                            }
                            MutabilityOwnership.m3737u("binding");
                            throw null;
                        }
                        MutabilityOwnership.m3737u("binding");
                        throw null;
                    }
                    MutabilityOwnership.m3737u("binding");
                    throw null;
                }
                MutabilityOwnership.m3737u("binding");
                throw null;
            }
            MutabilityOwnership.m3737u("binding");
            throw null;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    /* renamed from: Y0 */
    public final void m4527Y0() {
        Fragment F = m11131K0().m11279F("progress");
        if (F != null) {
            ((ProgressDialogFragment) F).dismiss();
        }
    }

    /* renamed from: Z0 */
    public final C3386c m4526Z0() {
        return (C3386c) this.f19416L.getValue();
    }

    /* renamed from: a1 */
    public final NovelBackupStore m4525a1() {
        return (NovelBackupStore) this.f19417M.getValue();
    }

    /* renamed from: b1 */
    public final NovelUploadActionCreator m4524b1() {
        return (NovelUploadActionCreator) this.f19414J.getValue();
    }

    /* renamed from: c1 */
    public final NovelUploadStore m4523c1() {
        return (NovelUploadStore) this.f19415K.getValue();
    }

    /* renamed from: d1 */
    public final void m4522d1(int i) {
        ActivityNovelUploadBinding r0Var = this.f19413I;
        if (r0Var != null) {
            TextView textView = r0Var.f22191r;
            MutabilityOwnership.m3746l(textView, "binding.captionCounter");
            StringMerger.m2861a(textView, i, ((Number) this.f19420P.getValue()).intValue());
            return;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    /* renamed from: e1 */
    public final void m4521e1(CommentAccessType commentAccessType) {
        int i = C4350b.f19425a[commentAccessType.ordinal()];
        if (i == 1) {
            ActivityNovelUploadBinding r0Var = this.f19413I;
            if (r0Var != null) {
                r0Var.f22194u.setChecked(true);
            } else {
                MutabilityOwnership.m3737u("binding");
                throw null;
            }
        } else if (i == 2) {
            ActivityNovelUploadBinding r0Var2 = this.f19413I;
            if (r0Var2 != null) {
                r0Var2.f22195v.setChecked(true);
            } else {
                MutabilityOwnership.m3737u("binding");
                throw null;
            }
        }
    }

    /* renamed from: f1 */
    public final void m4520f1(int i) {
        this.f19424Z = i;
        ActivityNovelUploadBinding r0Var = this.f19413I;
        if (r0Var != null) {
            TextView textView = r0Var.f22185N;
            MutabilityOwnership.m3746l(textView, "binding.titleCounter");
            StringMerger.m2861a(textView, i, ((Number) this.f19418N.getValue()).intValue());
            return;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    /* renamed from: g1 */
    public final void m4519g1(int i) {
        ActivityNovelUploadBinding r0Var = this.f19413I;
        if (r0Var != null) {
            TextView textView = r0Var.f22172A;
            MutabilityOwnership.m3746l(textView, "binding.novelTextCounter");
            StringMerger.m2861a(textView, i, ((Number) this.f19419O.getValue()).intValue());
            return;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    /* renamed from: h1 */
    public final void m4518h1(int i) {
        ActivityNovelUploadBinding r0Var = this.f19413I;
        if (r0Var != null) {
            TextView textView = r0Var.f22184M;
            MutabilityOwnership.m3746l(textView, "binding.tagCounter");
            StringMerger.m2844r(textView, i, 10);
            return;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    /* renamed from: i1 */
    public final void m4517i1() {
        FragmentManager K0 = m11131K0();
        MutabilityOwnership.m3746l(K0, "supportFragmentManager");
        String string = getString(R.string.upload_dialog_message_processing);
        MutabilityOwnership.m3746l(string, "getString(jp.pxv.android…ialog_message_processing)");
        StringMerger.m2843s(K0, ProgressDialogFragment.m12118f("", string), "progress");
    }

    /* renamed from: j1 */
    public final void m4516j1(String str) {
        Toast.makeText(this, str, 1).show();
    }

    @Override // androidx.activity.ComponentActivity, android.app.Activity
    public void onBackPressed() {
        FragmentManager K0 = m11131K0();
        MutabilityOwnership.m3746l(K0, "supportFragmentManager");
        EventPublishDialogFragment.C5840a aVar = EventPublishDialogFragment.f25435a;
        String string = getString(R.string.novel_upload_exit_dialog_title);
        String string2 = getString(R.string.novel_upload_exit_dialog_message);
        String string3 = getString(R.string.close);
        DiscardAndFinishNovelUpload discardAndFinishNovelUpload = new DiscardAndFinishNovelUpload();
        String string4 = getString(R.string.common_cancel);
        EventNone eventNone = new EventNone();
        MutabilityOwnership.m3746l(string3, "getString(jp.pxv.android.legacy.R.string.close)");
        StringMerger.m2843s(K0, EventPublishDialogFragment.C5840a.m2776c(aVar, string2, string3, string4, discardAndFinishNovelUpload, eventNone, string, false, 64), "novel_upload_exit_dialog");
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        boolean z;
        boolean z2;
        super.onCreate(bundle);
        ViewDataBinding d = DataBindingUtil.m11369d(this, R.layout.activity_novel_upload);
        MutabilityOwnership.m3746l(d, "setContentView(this, R.l…ut.activity_novel_upload)");
        this.f19413I = (ActivityNovelUploadBinding) d;
        m4527Y0();
        ActivityNovelUploadBinding r0Var = this.f19413I;
        if (r0Var != null) {
            C1124a.m10197Q(this, r0Var.f22187P, R.string.novel_upload_title);
            ActivityNovelUploadBinding r0Var2 = this.f19413I;
            if (r0Var2 != null) {
                r0Var2.f22199z.m4595d(InfoType.LOADING, null);
                ActivityNovelUploadBinding r0Var3 = this.f19413I;
                if (r0Var3 != null) {
                    r0Var3.f22173B.setOnClickListener(new View$OnClickListenerC2959i(this, 0));
                    ActivityNovelUploadBinding r0Var4 = this.f19413I;
                    if (r0Var4 != null) {
                        r0Var4.f22192s.setOnClickListener(new View$OnClickListenerC2960j(this, 0));
                        m4520f1(0);
                        m4519g1(0);
                        m4522d1(0);
                        m4518h1(0);
                        ActivityNovelUploadBinding r0Var5 = this.f19413I;
                        if (r0Var5 != null) {
                            r0Var5.f22186O.addTextChangedListener(new TextChangedCounter(new C2963n(this)));
                            ActivityNovelUploadBinding r0Var6 = this.f19413I;
                            if (r0Var6 != null) {
                                r0Var6.f22189R.setOnChangedTagCountListener(new C2965p(this));
                                m4523c1().f15826k.mo2790a(this, new C2964o(this));
                                m4525a1().f15769j.mo2790a(this, new p138em.NovelUploadActivity(this));
                                Preconditions.m9798T(m4523c1().f15827l, this, new C2966q(this));
                                Preconditions.m9798T(m4523c1().f15828m, this, new C2967r(this));
                                Preconditions.m9798T(m4523c1().f15829n, this, new C2968s(this));
                                Preconditions.m9798T(m4523c1().f15830o, this, new C2969t(this));
                                ActivityNovelUploadBinding r0Var7 = this.f19413I;
                                if (r0Var7 != null) {
                                    r0Var7.f22188Q.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver$OnGlobalLayoutListenerC4354f());
                                    ActivityNovelUploadBinding r0Var8 = this.f19413I;
                                    if (r0Var8 != null) {
                                        r0Var8.f22183L.setOnClickListener(new View.OnClickListener(this, 0) { // from class: em.l

                                            /* renamed from: a */
                                            public final /* synthetic */ int f13911a;

                                            /* renamed from: b */
                                            public final /* synthetic */ NovelUploadActivity f13912b;

                                            {
                                                this.f13911a = r2;
                                                this.f13912b = r1;
                                            }

                                            @Override // android.view.View.OnClickListener
                                            public final void onClick(View view) {
                                                switch (this.f13911a) {
                                                    case 0:
                                                        NovelUploadActivity novelUploadActivity = this.f13912b;
                                                        NovelUploadActivity.C4349a aVar = NovelUploadActivity.f19410a0;
                                                        MutabilityOwnership.m3745m(novelUploadActivity, "this$0");
                                                        PixivAnalytics eVar = novelUploadActivity.f18757A;
                                                        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
                                                        eVar.m6527c(3, AnalyticsAction.UPLOAD_POPUP_DISPLAY_NOVEL, null);
                                                        FragmentManager K0 = novelUploadActivity.m11131K0();
                                                        MutabilityOwnership.m3746l(K0, "supportFragmentManager");
                                                        EventPublishDialogFragment.C5840a aVar2 = EventPublishDialogFragment.f25435a;
                                                        String string = novelUploadActivity.getString(R.string.upload_confirm);
                                                        String string2 = novelUploadActivity.getString(R.string.common_ok);
                                                        NovelUploadSubmitPopupOK novelUploadSubmitPopupOK = new NovelUploadSubmitPopupOK();
                                                        String string3 = novelUploadActivity.getString(R.string.common_cancel);
                                                        NovelUploadSubmitPopupCancel novelUploadSubmitPopupCancel = new NovelUploadSubmitPopupCancel();
                                                        MutabilityOwnership.m3746l(string2, "getString(jp.pxv.android…egacy.R.string.common_ok)");
                                                        StringMerger.m2843s(K0, EventPublishDialogFragment.C5840a.m2776c(aVar2, string, string2, string3, novelUploadSubmitPopupOK, novelUploadSubmitPopupCancel, null, false, 32), "novel_upload_submit_popup");
                                                        C5453b.m3264m(novelUploadActivity);
                                                        return;
                                                    case 1:
                                                        NovelUploadActivity novelUploadActivity2 = this.f13912b;
                                                        NovelUploadActivity.C4349a aVar3 = NovelUploadActivity.f19410a0;
                                                        MutabilityOwnership.m3745m(novelUploadActivity2, "this$0");
                                                        C5453b.m3264m(novelUploadActivity2);
                                                        return;
                                                    default:
                                                        NovelUploadActivity novelUploadActivity3 = this.f13912b;
                                                        NovelUploadActivity.C4349a aVar4 = NovelUploadActivity.f19410a0;
                                                        MutabilityOwnership.m3745m(novelUploadActivity3, "this$0");
                                                        C5453b.m3264m(novelUploadActivity3);
                                                        return;
                                                }
                                            }
                                        });
                                        ActivityNovelUploadBinding r0Var9 = this.f19413I;
                                        if (r0Var9 != null) {
                                            r0Var9.f22198y.setOnClickListener(new View.OnClickListener(this, 0) { // from class: em.k

                                                /* renamed from: a */
                                                public final /* synthetic */ int f13909a;

                                                /* renamed from: b */
                                                public final /* synthetic */ NovelUploadActivity f13910b;

                                                {
                                                    this.f13909a = r2;
                                                    this.f13910b = r1;
                                                }

                                                /*  JADX ERROR: Method code generation error
                                                    jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0053: INVOKE  (r0v9 'e' zc.b) = 
                                                      (wrap: wc.p<R> : 0x0045: INVOKE  (r0v8 wc.p<R> A[REMOVE]) = 
                                                      (wrap: jd.h : 0x0040: CONSTRUCTOR  (r3v3 jd.h A[REMOVE]) = 
                                                      (wrap: jd.a : 0x0035: CONSTRUCTOR  (r0v6 jd.a A[REMOVE]) = 
                                                      (wrap: gm.g : 0x0030: CONSTRUCTOR  (r1v9 gm.g A[REMOVE]) = (r0v1 'X0' zl.b) call: gm.g.<init>(java.lang.Object):void type: CONSTRUCTOR)
                                                     call: jd.a.<init>(wc.s):void type: CONSTRUCTOR)
                                                      (wrap: gl.i : 0x003b: CONSTRUCTOR  (r1v10 gl.i A[REMOVE]) = (r5v6 'b1' gm.h), (2 int) call: gl.i.<init>(java.lang.Object, int):void type: CONSTRUCTOR)
                                                     call: jd.h.<init>(wc.t, ad.f):void type: CONSTRUCTOR)
                                                      (wrap: wc.o : 0x0043: SGET  (r0v7 wc.o A[REMOVE]) =  sd.a.c wc.o)
                                                     type: VIRTUAL call: wc.p.o(wc.o):wc.p)
                                                      (wrap: gm.m : 0x004b: CONSTRUCTOR  (r1v11 gm.m A[REMOVE]) = (r5v6 'b1' gm.h) call: gm.m.<init>(gm.h):void type: CONSTRUCTOR)
                                                      (wrap: gm.n : 0x0050: CONSTRUCTOR  (r3v4 gm.n A[REMOVE]) = (r5v6 'b1' gm.h) call: gm.n.<init>(gm.h):void type: CONSTRUCTOR)
                                                     type: STATIC call: rd.a.e(wc.p, gn.l, gn.l):zc.b in method: em.k.onClick(android.view.View):void, file: classes2.dex
                                                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:270)
                                                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:233)
                                                    	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:90)
                                                    	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                    	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:79)
                                                    	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:122)
                                                    	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                    	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:79)
                                                    	at jadx.core.codegen.RegionGen.makeSwitch(RegionGen.java:266)
                                                    	at jadx.core.dex.regions.SwitchRegion.generate(SwitchRegion.java:79)
                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                    	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:255)
                                                    	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:248)
                                                    	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:369)
                                                    Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: gm.g, state: NOT_LOADED
                                                    	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:268)
                                                    	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:668)
                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:378)
                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                    	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:974)
                                                    	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:709)
                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:378)
                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                    	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:974)
                                                    	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:709)
                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:378)
                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                    	at jadx.core.codegen.InsnGen.addArgDot(InsnGen.java:93)
                                                    	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:768)
                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:382)
                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                    	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:974)
                                                    	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:799)
                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:382)
                                                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:263)
                                                    	... 23 more
                                                    */
                                                @Override // android.view.View.OnClickListener
                                                public final void onClick(android.view.View r5) {
                                                    /*
                                                        r4 = this;
                                                        int r5 = r4.f13909a
                                                        java.lang.String r0 = "this$0"
                                                        switch(r5) {
                                                            case 0: goto L_0x0009;
                                                            default: goto L_0x0007;
                                                        }
                                                    L_0x0007:
                                                        goto L_0x009d
                                                    L_0x0009:
                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity r5 = r4.f13910b
                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$a r1 = p270jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity.f19410a0
                                                        p325m0.MutabilityOwnership.m3745m(r5, r0)
                                                        zl.b r0 = r5.m4528X0()
                                                        r5.m4517i1()
                                                        java.lang.Long r1 = r0.f31489a
                                                        if (r1 == 0) goto L_0x001d
                                                        r1 = 1
                                                        goto L_0x001e
                                                    L_0x001d:
                                                        r1 = 0
                                                    L_0x001e:
                                                        java.lang.String r2 = "compositeDisposable"
                                                        if (r1 != 0) goto L_0x0060
                                                        gm.h r5 = r5.m4524b1()
                                                        java.util.Objects.requireNonNull(r5)
                                                        am.b r1 = r5.f15791c
                                                        java.util.Objects.requireNonNull(r1)
                                                        gm.g r1 = new gm.g
                                                        r1.<init>(r0)
                                                        jd.a r0 = new jd.a
                                                        r0.<init>(r1)
                                                        gl.i r1 = new gl.i
                                                        r3 = 2
                                                        r1.<init>(r5, r3)
                                                        jd.h r3 = new jd.h
                                                        r3.<init>(r0, r1)
                                                        wc.o r0 = p491sd.C6034a.f26178c
                                                        wc.p r0 = r3.m961o(r0)
                                                        gm.m r1 = new gm.m
                                                        r1.<init>(r5)
                                                        gm.n r3 = new gm.n
                                                        r3.<init>(r5)
                                                        zc.b r0 = p467rd.subscribers.m2591e(r0, r1, r3)
                                                        zc.a r5 = r5.f15794f
                                                        p325m0.MutabilityOwnership.m3744n(r5, r2)
                                                        r5.mo82c(r0)
                                                        goto L_0x009c
                                                    L_0x0060:
                                                        gm.h r5 = r5.m4524b1()
                                                        java.util.Objects.requireNonNull(r5)
                                                        am.b r1 = r5.f15791c
                                                        java.util.Objects.requireNonNull(r1)
                                                        gm.g r1 = new gm.g
                                                        r1.<init>(r0)
                                                        jd.a r0 = new jd.a
                                                        r0.<init>(r1)
                                                        gm.g r1 = new gm.g
                                                        r1.<init>(r5)
                                                        jd.i r3 = new jd.i
                                                        r3.<init>(r0, r1)
                                                        wc.o r0 = p491sd.C6034a.f26178c
                                                        wc.a r0 = r3.m1008i(r0)
                                                        gm.i r1 = new gm.i
                                                        r1.<init>(r5)
                                                        gm.j r3 = new gm.j
                                                        r3.<init>(r5)
                                                        zc.b r0 = p467rd.subscribers.m2592d(r0, r1, r3)
                                                        zc.a r5 = r5.f15794f
                                                        p325m0.MutabilityOwnership.m3744n(r5, r2)
                                                        r5.mo82c(r0)
                                                    L_0x009c:
                                                        return
                                                    L_0x009d:
                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity r5 = r4.f13910b
                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$a r1 = p270jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity.f19410a0
                                                        p325m0.MutabilityOwnership.m3745m(r5, r0)
                                                        p393of.C5453b.m3264m(r5)
                                                        return
                                                    */
                                                    throw new UnsupportedOperationException("Method not decompiled: p138em.View$OnClickListenerC2961k.onClick(android.view.View):void");
                                                }
                                            });
                                            ActivityNovelUploadBinding r0Var10 = this.f19413I;
                                            if (r0Var10 != null) {
                                                r0Var10.f22175D.setOnClickListener(new View$OnClickListenerC2957g(this, 0));
                                                ActivityNovelUploadBinding r0Var11 = this.f19413I;
                                                if (r0Var11 != null) {
                                                    r0Var11.f22180I.setOnClickListener(new View.OnClickListener(this, 0) { // from class: em.h

                                                        /* renamed from: a */
                                                        public final /* synthetic */ int f13903a;

                                                        /* renamed from: b */
                                                        public final /* synthetic */ NovelUploadActivity f13904b;

                                                        {
                                                            this.f13903a = r2;
                                                            this.f13904b = r1;
                                                        }

                                                        @Override // android.view.View.OnClickListener
                                                        public final void onClick(View view) {
                                                            switch (this.f13903a) {
                                                                case 0:
                                                                    NovelUploadActivity novelUploadActivity = this.f13904b;
                                                                    NovelUploadActivity.C4349a aVar = NovelUploadActivity.f19410a0;
                                                                    MutabilityOwnership.m3745m(novelUploadActivity, "this$0");
                                                                    C5453b.m3264m(novelUploadActivity);
                                                                    return;
                                                                default:
                                                                    NovelUploadActivity novelUploadActivity2 = this.f13904b;
                                                                    NovelUploadActivity.C4349a aVar2 = NovelUploadActivity.f19410a0;
                                                                    MutabilityOwnership.m3745m(novelUploadActivity2, "this$0");
                                                                    C5453b.m3264m(novelUploadActivity2);
                                                                    return;
                                                            }
                                                        }
                                                    });
                                                    ActivityNovelUploadBinding r0Var12 = this.f19413I;
                                                    if (r0Var12 != null) {
                                                        boolean z3 = true;
                                                        r0Var12.f22181J.setOnClickListener(new View.OnClickListener(this, 1) { // from class: em.l

                                                            /* renamed from: a */
                                                            public final /* synthetic */ int f13911a;

                                                            /* renamed from: b */
                                                            public final /* synthetic */ NovelUploadActivity f13912b;

                                                            {
                                                                this.f13911a = r2;
                                                                this.f13912b = r1;
                                                            }

                                                            @Override // android.view.View.OnClickListener
                                                            public final void onClick(View view) {
                                                                switch (this.f13911a) {
                                                                    case 0:
                                                                        NovelUploadActivity novelUploadActivity = this.f13912b;
                                                                        NovelUploadActivity.C4349a aVar = NovelUploadActivity.f19410a0;
                                                                        MutabilityOwnership.m3745m(novelUploadActivity, "this$0");
                                                                        PixivAnalytics eVar = novelUploadActivity.f18757A;
                                                                        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
                                                                        eVar.m6527c(3, AnalyticsAction.UPLOAD_POPUP_DISPLAY_NOVEL, null);
                                                                        FragmentManager K0 = novelUploadActivity.m11131K0();
                                                                        MutabilityOwnership.m3746l(K0, "supportFragmentManager");
                                                                        EventPublishDialogFragment.C5840a aVar2 = EventPublishDialogFragment.f25435a;
                                                                        String string = novelUploadActivity.getString(R.string.upload_confirm);
                                                                        String string2 = novelUploadActivity.getString(R.string.common_ok);
                                                                        NovelUploadSubmitPopupOK novelUploadSubmitPopupOK = new NovelUploadSubmitPopupOK();
                                                                        String string3 = novelUploadActivity.getString(R.string.common_cancel);
                                                                        NovelUploadSubmitPopupCancel novelUploadSubmitPopupCancel = new NovelUploadSubmitPopupCancel();
                                                                        MutabilityOwnership.m3746l(string2, "getString(jp.pxv.android…egacy.R.string.common_ok)");
                                                                        StringMerger.m2843s(K0, EventPublishDialogFragment.C5840a.m2776c(aVar2, string, string2, string3, novelUploadSubmitPopupOK, novelUploadSubmitPopupCancel, null, false, 32), "novel_upload_submit_popup");
                                                                        C5453b.m3264m(novelUploadActivity);
                                                                        return;
                                                                    case 1:
                                                                        NovelUploadActivity novelUploadActivity2 = this.f13912b;
                                                                        NovelUploadActivity.C4349a aVar3 = NovelUploadActivity.f19410a0;
                                                                        MutabilityOwnership.m3745m(novelUploadActivity2, "this$0");
                                                                        C5453b.m3264m(novelUploadActivity2);
                                                                        return;
                                                                    default:
                                                                        NovelUploadActivity novelUploadActivity3 = this.f13912b;
                                                                        NovelUploadActivity.C4349a aVar4 = NovelUploadActivity.f19410a0;
                                                                        MutabilityOwnership.m3745m(novelUploadActivity3, "this$0");
                                                                        C5453b.m3264m(novelUploadActivity3);
                                                                        return;
                                                                }
                                                            }
                                                        });
                                                        ActivityNovelUploadBinding r0Var13 = this.f19413I;
                                                        if (r0Var13 != null) {
                                                            r0Var13.f22182K.setOnClickListener(new View.OnClickListener(this, 1) { // from class: em.k

                                                                /* renamed from: a */
                                                                public final /* synthetic */ int f13909a;

                                                                /* renamed from: b */
                                                                public final /* synthetic */ NovelUploadActivity f13910b;

                                                                {
                                                                    this.f13909a = r2;
                                                                    this.f13910b = r1;
                                                                }

                                                                /*  JADX ERROR: Method code generation error
                                                                    jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0053: INVOKE  (r0v9 'e' zc.b) = 
                                                                      (wrap: wc.p<R> : 0x0045: INVOKE  (r0v8 wc.p<R> A[REMOVE]) = 
                                                                      (wrap: jd.h : 0x0040: CONSTRUCTOR  (r3v3 jd.h A[REMOVE]) = 
                                                                      (wrap: jd.a : 0x0035: CONSTRUCTOR  (r0v6 jd.a A[REMOVE]) = 
                                                                      (wrap: gm.g : 0x0030: CONSTRUCTOR  (r1v9 gm.g A[REMOVE]) = (r0v1 'X0' zl.b) call: gm.g.<init>(java.lang.Object):void type: CONSTRUCTOR)
                                                                     call: jd.a.<init>(wc.s):void type: CONSTRUCTOR)
                                                                      (wrap: gl.i : 0x003b: CONSTRUCTOR  (r1v10 gl.i A[REMOVE]) = (r5v6 'b1' gm.h), (2 int) call: gl.i.<init>(java.lang.Object, int):void type: CONSTRUCTOR)
                                                                     call: jd.h.<init>(wc.t, ad.f):void type: CONSTRUCTOR)
                                                                      (wrap: wc.o : 0x0043: SGET  (r0v7 wc.o A[REMOVE]) =  sd.a.c wc.o)
                                                                     type: VIRTUAL call: wc.p.o(wc.o):wc.p)
                                                                      (wrap: gm.m : 0x004b: CONSTRUCTOR  (r1v11 gm.m A[REMOVE]) = (r5v6 'b1' gm.h) call: gm.m.<init>(gm.h):void type: CONSTRUCTOR)
                                                                      (wrap: gm.n : 0x0050: CONSTRUCTOR  (r3v4 gm.n A[REMOVE]) = (r5v6 'b1' gm.h) call: gm.n.<init>(gm.h):void type: CONSTRUCTOR)
                                                                     type: STATIC call: rd.a.e(wc.p, gn.l, gn.l):zc.b in method: em.k.onClick(android.view.View):void, file: classes2.dex
                                                                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:270)
                                                                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:233)
                                                                    	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:90)
                                                                    	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                                    	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:79)
                                                                    	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:122)
                                                                    	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                                    	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:79)
                                                                    	at jadx.core.codegen.RegionGen.makeSwitch(RegionGen.java:266)
                                                                    	at jadx.core.dex.regions.SwitchRegion.generate(SwitchRegion.java:79)
                                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                                    	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                                                    	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                                                                    	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:255)
                                                                    	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:248)
                                                                    Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: gm.g, state: NOT_LOADED
                                                                    	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:268)
                                                                    	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:668)
                                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:378)
                                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                                    	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:974)
                                                                    	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:709)
                                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:378)
                                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                                    	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:974)
                                                                    	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:709)
                                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:378)
                                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                                    	at jadx.core.codegen.InsnGen.addArgDot(InsnGen.java:93)
                                                                    	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:768)
                                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:382)
                                                                    	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:132)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:117)
                                                                    	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                                                    	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:974)
                                                                    	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:799)
                                                                    	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:382)
                                                                    	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:263)
                                                                    	... 22 more
                                                                    */
                                                                @Override // android.view.View.OnClickListener
                                                                public final void onClick(android.view.View r5) {
                                                                    /*
                                                                        r4 = this;
                                                                        int r5 = r4.f13909a
                                                                        java.lang.String r0 = "this$0"
                                                                        switch(r5) {
                                                                            case 0: goto L_0x0009;
                                                                            default: goto L_0x0007;
                                                                        }
                                                                    L_0x0007:
                                                                        goto L_0x009d
                                                                    L_0x0009:
                                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity r5 = r4.f13910b
                                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$a r1 = p270jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity.f19410a0
                                                                        p325m0.MutabilityOwnership.m3745m(r5, r0)
                                                                        zl.b r0 = r5.m4528X0()
                                                                        r5.m4517i1()
                                                                        java.lang.Long r1 = r0.f31489a
                                                                        if (r1 == 0) goto L_0x001d
                                                                        r1 = 1
                                                                        goto L_0x001e
                                                                    L_0x001d:
                                                                        r1 = 0
                                                                    L_0x001e:
                                                                        java.lang.String r2 = "compositeDisposable"
                                                                        if (r1 != 0) goto L_0x0060
                                                                        gm.h r5 = r5.m4524b1()
                                                                        java.util.Objects.requireNonNull(r5)
                                                                        am.b r1 = r5.f15791c
                                                                        java.util.Objects.requireNonNull(r1)
                                                                        gm.g r1 = new gm.g
                                                                        r1.<init>(r0)
                                                                        jd.a r0 = new jd.a
                                                                        r0.<init>(r1)
                                                                        gl.i r1 = new gl.i
                                                                        r3 = 2
                                                                        r1.<init>(r5, r3)
                                                                        jd.h r3 = new jd.h
                                                                        r3.<init>(r0, r1)
                                                                        wc.o r0 = p491sd.C6034a.f26178c
                                                                        wc.p r0 = r3.m961o(r0)
                                                                        gm.m r1 = new gm.m
                                                                        r1.<init>(r5)
                                                                        gm.n r3 = new gm.n
                                                                        r3.<init>(r5)
                                                                        zc.b r0 = p467rd.subscribers.m2591e(r0, r1, r3)
                                                                        zc.a r5 = r5.f15794f
                                                                        p325m0.MutabilityOwnership.m3744n(r5, r2)
                                                                        r5.mo82c(r0)
                                                                        goto L_0x009c
                                                                    L_0x0060:
                                                                        gm.h r5 = r5.m4524b1()
                                                                        java.util.Objects.requireNonNull(r5)
                                                                        am.b r1 = r5.f15791c
                                                                        java.util.Objects.requireNonNull(r1)
                                                                        gm.g r1 = new gm.g
                                                                        r1.<init>(r0)
                                                                        jd.a r0 = new jd.a
                                                                        r0.<init>(r1)
                                                                        gm.g r1 = new gm.g
                                                                        r1.<init>(r5)
                                                                        jd.i r3 = new jd.i
                                                                        r3.<init>(r0, r1)
                                                                        wc.o r0 = p491sd.C6034a.f26178c
                                                                        wc.a r0 = r3.m1008i(r0)
                                                                        gm.i r1 = new gm.i
                                                                        r1.<init>(r5)
                                                                        gm.j r3 = new gm.j
                                                                        r3.<init>(r5)
                                                                        zc.b r0 = p467rd.subscribers.m2592d(r0, r1, r3)
                                                                        zc.a r5 = r5.f15794f
                                                                        p325m0.MutabilityOwnership.m3744n(r5, r2)
                                                                        r5.mo82c(r0)
                                                                    L_0x009c:
                                                                        return
                                                                    L_0x009d:
                                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity r5 = r4.f13910b
                                                                        jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity$a r1 = p270jp.pxv.android.uploadNovel.presentation.activity.NovelUploadActivity.f19410a0
                                                                        p325m0.MutabilityOwnership.m3745m(r5, r0)
                                                                        p393of.C5453b.m3264m(r5)
                                                                        return
                                                                    */
                                                                    throw new UnsupportedOperationException("Method not decompiled: p138em.View$OnClickListenerC2961k.onClick(android.view.View):void");
                                                                }
                                                            });
                                                            ActivityNovelUploadBinding r0Var14 = this.f19413I;
                                                            if (r0Var14 != null) {
                                                                r0Var14.f22178G.setOnClickListener(new View$OnClickListenerC2959i(this, 1));
                                                                ActivityNovelUploadBinding r0Var15 = this.f19413I;
                                                                if (r0Var15 != null) {
                                                                    r0Var15.f22176E.setOnClickListener(new View$OnClickListenerC2960j(this, 1));
                                                                    ActivityNovelUploadBinding r0Var16 = this.f19413I;
                                                                    if (r0Var16 != null) {
                                                                        r0Var16.f22177F.setOnClickListener(new View$OnClickListenerC2957g(this, 1));
                                                                        ActivityNovelUploadBinding r0Var17 = this.f19413I;
                                                                        if (r0Var17 != null) {
                                                                            r0Var17.f22194u.setOnClickListener(new View.OnClickListener(this, 1) { // from class: em.h

                                                                                /* renamed from: a */
                                                                                public final /* synthetic */ int f13903a;

                                                                                /* renamed from: b */
                                                                                public final /* synthetic */ NovelUploadActivity f13904b;

                                                                                {
                                                                                    this.f13903a = r2;
                                                                                    this.f13904b = r1;
                                                                                }

                                                                                @Override // android.view.View.OnClickListener
                                                                                public final void onClick(View view) {
                                                                                    switch (this.f13903a) {
                                                                                        case 0:
                                                                                            NovelUploadActivity novelUploadActivity = this.f13904b;
                                                                                            NovelUploadActivity.C4349a aVar = NovelUploadActivity.f19410a0;
                                                                                            MutabilityOwnership.m3745m(novelUploadActivity, "this$0");
                                                                                            C5453b.m3264m(novelUploadActivity);
                                                                                            return;
                                                                                        default:
                                                                                            NovelUploadActivity novelUploadActivity2 = this.f13904b;
                                                                                            NovelUploadActivity.C4349a aVar2 = NovelUploadActivity.f19410a0;
                                                                                            MutabilityOwnership.m3745m(novelUploadActivity2, "this$0");
                                                                                            C5453b.m3264m(novelUploadActivity2);
                                                                                            return;
                                                                                    }
                                                                                }
                                                                            });
                                                                            ActivityNovelUploadBinding r0Var18 = this.f19413I;
                                                                            if (r0Var18 != null) {
                                                                                r0Var18.f22195v.setOnClickListener(new View.OnClickListener(this, 2) { // from class: em.l

                                                                                    /* renamed from: a */
                                                                                    public final /* synthetic */ int f13911a;

                                                                                    /* renamed from: b */
                                                                                    public final /* synthetic */ NovelUploadActivity f13912b;

                                                                                    {
                                                                                        this.f13911a = r2;
                                                                                        this.f13912b = r1;
                                                                                    }

                                                                                    @Override // android.view.View.OnClickListener
                                                                                    public final void onClick(View view) {
                                                                                        switch (this.f13911a) {
                                                                                            case 0:
                                                                                                NovelUploadActivity novelUploadActivity = this.f13912b;
                                                                                                NovelUploadActivity.C4349a aVar = NovelUploadActivity.f19410a0;
                                                                                                MutabilityOwnership.m3745m(novelUploadActivity, "this$0");
                                                                                                PixivAnalytics eVar = novelUploadActivity.f18757A;
                                                                                                MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
                                                                                                eVar.m6527c(3, AnalyticsAction.UPLOAD_POPUP_DISPLAY_NOVEL, null);
                                                                                                FragmentManager K0 = novelUploadActivity.m11131K0();
                                                                                                MutabilityOwnership.m3746l(K0, "supportFragmentManager");
                                                                                                EventPublishDialogFragment.C5840a aVar2 = EventPublishDialogFragment.f25435a;
                                                                                                String string = novelUploadActivity.getString(R.string.upload_confirm);
                                                                                                String string2 = novelUploadActivity.getString(R.string.common_ok);
                                                                                                NovelUploadSubmitPopupOK novelUploadSubmitPopupOK = new NovelUploadSubmitPopupOK();
                                                                                                String string3 = novelUploadActivity.getString(R.string.common_cancel);
                                                                                                NovelUploadSubmitPopupCancel novelUploadSubmitPopupCancel = new NovelUploadSubmitPopupCancel();
                                                                                                MutabilityOwnership.m3746l(string2, "getString(jp.pxv.android…egacy.R.string.common_ok)");
                                                                                                StringMerger.m2843s(K0, EventPublishDialogFragment.C5840a.m2776c(aVar2, string, string2, string3, novelUploadSubmitPopupOK, novelUploadSubmitPopupCancel, null, false, 32), "novel_upload_submit_popup");
                                                                                                C5453b.m3264m(novelUploadActivity);
                                                                                                return;
                                                                                            case 1:
                                                                                                NovelUploadActivity novelUploadActivity2 = this.f13912b;
                                                                                                NovelUploadActivity.C4349a aVar3 = NovelUploadActivity.f19410a0;
                                                                                                MutabilityOwnership.m3745m(novelUploadActivity2, "this$0");
                                                                                                C5453b.m3264m(novelUploadActivity2);
                                                                                                return;
                                                                                            default:
                                                                                                NovelUploadActivity novelUploadActivity3 = this.f13912b;
                                                                                                NovelUploadActivity.C4349a aVar4 = NovelUploadActivity.f19410a0;
                                                                                                MutabilityOwnership.m3745m(novelUploadActivity3, "this$0");
                                                                                                C5453b.m3264m(novelUploadActivity3);
                                                                                                return;
                                                                                        }
                                                                                    }
                                                                                });
                                                                                C3386c Z0 = m4526Z0();
                                                                                boolean booleanExtra = getIntent().getBooleanExtra("bundle_key_selected_restore_from_my_works", false);
                                                                                if (bundle == null) {
                                                                                    z = false;
                                                                                } else {
                                                                                    z = bundle.getBoolean("saved_state_is_finished_restore_flow_by_user");
                                                                                }
                                                                                Objects.requireNonNull(Z0);
                                                                                Z0.f15753d.mo2437b(new NovelBackupAction.C3379f(booleanExtra, z));
                                                                                NovelUploadActionCreator b1 = m4524b1();
                                                                                if (bundle == null) {
                                                                                    z2 = false;
                                                                                } else {
                                                                                    z2 = bundle.getBoolean("saved_state_did_saved_draft");
                                                                                }
                                                                                b1.f15793e.mo2437b(new NovelUploadAction.C3401i(z2));
                                                                                Bundle extras = getIntent().getExtras();
                                                                                if (extras == null || !extras.containsKey("bundle_key_draft_id_to_init_with")) {
                                                                                    m4524b1().m5796h(false);
                                                                                } else {
                                                                                    m4524b1().m5797g(extras.getLong("bundle_key_draft_id_to_init_with"));
                                                                                    if (bundle != null) {
                                                                                        z3 = bundle.getBoolean("saved_state_is_finished_load_draft_from_intent", true);
                                                                                    }
                                                                                    m4524b1().m5796h(z3);
                                                                                }
                                                                                m4524b1().m5800d();
                                                                                NovelUploadActionCreator b12 = m4524b1();
                                                                                String language = Locale.getDefault().getLanguage();
                                                                                MutabilityOwnership.m3746l(language, "getDefault().language");
                                                                                Objects.requireNonNull(b12);
                                                                                if (!MutabilityOwnership.m3749h(language, "ja")) {
                                                                                    NovelUploadSettings aVar = b12.f15792d;
                                                                                    if (!aVar.f24011a.getBoolean(aVar.f24012b, false)) {
                                                                                        b12.f15793e.mo2437b(NovelUploadAction.C3403k.f15780a);
                                                                                        return;
                                                                                    }
                                                                                    return;
                                                                                }
                                                                                return;
                                                                            }
                                                                            MutabilityOwnership.m3737u("binding");
                                                                            throw null;
                                                                        }
                                                                        MutabilityOwnership.m3737u("binding");
                                                                        throw null;
                                                                    }
                                                                    MutabilityOwnership.m3737u("binding");
                                                                    throw null;
                                                                }
                                                                MutabilityOwnership.m3737u("binding");
                                                                throw null;
                                                            }
                                                            MutabilityOwnership.m3737u("binding");
                                                            throw null;
                                                        }
                                                        MutabilityOwnership.m3737u("binding");
                                                        throw null;
                                                    }
                                                    MutabilityOwnership.m3737u("binding");
                                                    throw null;
                                                }
                                                MutabilityOwnership.m3737u("binding");
                                                throw null;
                                            }
                                            MutabilityOwnership.m3737u("binding");
                                            throw null;
                                        }
                                        MutabilityOwnership.m3737u("binding");
                                        throw null;
                                    }
                                    MutabilityOwnership.m3737u("binding");
                                    throw null;
                                }
                                MutabilityOwnership.m3737u("binding");
                                throw null;
                            }
                            MutabilityOwnership.m3737u("binding");
                            throw null;
                        }
                        MutabilityOwnership.m3737u("binding");
                        throw null;
                    }
                    MutabilityOwnership.m3737u("binding");
                    throw null;
                }
                MutabilityOwnership.m3737u("binding");
                throw null;
            }
            MutabilityOwnership.m3737u("binding");
            throw null;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        super.onDestroy();
        m4524b1().f15794f.m80f();
    }

    @Subscribe
    public final void onEvent(NovelUploadSubmitPopupOK novelUploadSubmitPopupOK) {
        MutabilityOwnership.m3745m(novelUploadSubmitPopupOK, "event");
        NovelPostParameter X0 = m4528X0();
        PixivAnalytics eVar = this.f18757A;
        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
        eVar.m6527c(3, AnalyticsAction.UPLOAD_POPUP_OK_NOVEL, null);
        m4517i1();
        NovelUploadActionCreator b1 = m4524b1();
        Objects.requireNonNull(b1);
        Objects.requireNonNull(b1.f15791c);
        Disposable e = subscribers.m2591e(new SingleFlatMap(new SingleCreate(new C3370t(X0)), new C7296l(b1, 25)).m961o(C6034a.f26178c), new C3419k(b1), new C3420l(b1));
        CompositeDisposable aVar = b1.f15794f;
        MutabilityOwnership.m3744n(aVar, "compositeDisposable");
        aVar.mo82c(e);
    }

    @Override // androidx.activity.ComponentActivity, android.app.Activity
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        MutabilityOwnership.m3745m(menuItem, "item");
        if (menuItem.getItemId() != 16908332) {
            return super.onOptionsItemSelected(menuItem);
        }
        onBackPressed();
        return true;
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onPause() {
        super.onPause();
        m4526Z0().f15754e.mo78a();
        m4526Z0().f15753d.mo2437b(NovelBackupAction.C3384k.f15749a);
    }

    @Override // p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onResume() {
        NovelPostParameter c;
        super.onResume();
        if (m4525a1().f15767h) {
            C3386c Z0 = m4526Z0();
            if (Z0.f15752c.m12056b() && (c = Z0.f15752c.m12055c()) != null) {
                Z0.f15753d.mo2437b(new NovelBackupAction.C3381h(c));
            }
        }
        C3386c Z02 = m4526Z0();
        Z02.f15754e.mo78a();
        Objects.requireNonNull(Z02.f15752c);
        Z02.f15754e = subscribers.m2589g(AbstractC6902j.m988m(60, 60, TimeUnit.SECONDS), null, null, new NovelBackupActionCreator(Z02), 3);
        m4526Z0().f15753d.mo2437b(NovelBackupAction.C3374a.f15738a);
    }

    @Override // androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onSaveInstanceState(Bundle bundle) {
        MutabilityOwnership.m3745m(bundle, "outState");
        super.onSaveInstanceState(bundle);
        bundle.putBoolean("saved_state_is_finished_restore_flow_by_user", m4525a1().f15767h);
        Boolean f = m4523c1().f15832q.m11091f();
        if (f != null) {
            bundle.putBoolean("saved_state_is_finished_load_draft_from_intent", f.booleanValue());
        }
        bundle.putBoolean("saved_state_did_saved_draft", m4523c1().f15833r);
    }

    @Subscribe
    public final void onEvent(NovelUploadSubmitPopupCancel novelUploadSubmitPopupCancel) {
        MutabilityOwnership.m3745m(novelUploadSubmitPopupCancel, "event");
        PixivAnalytics eVar = this.f18757A;
        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
        eVar.m6527c(3, AnalyticsAction.UPLOAD_POPUP_CANCEL_NOVEL, null);
    }

    @Subscribe
    public final void onEvent(DiscardAndFinishNovelUpload discardAndFinishNovelUpload) {
        MutabilityOwnership.m3745m(discardAndFinishNovelUpload, "event");
        if (m4523c1().f15833r) {
            setResult(2);
        }
        C3386c Z0 = m4526Z0();
        Z0.f15752c.m12057a();
        Z0.f15753d.mo2437b(NovelBackupAction.C3377d.f15741a);
    }

    @Subscribe
    public final void onEvent(RestoreNovelBackup restoreNovelBackup) {
        MutabilityOwnership.m3745m(restoreNovelBackup, "event");
        PixivAnalytics eVar = this.f18757A;
        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
        eVar.m6527c(3, AnalyticsAction.UPLOAD_NOVEL_RESTORE_VIA_UPLOAD, null);
        C3386c Z0 = m4526Z0();
        NovelPostParameter c = Z0.f15752c.m12055c();
        if (c != null) {
            Z0.f15753d.mo2437b(new NovelBackupAction.C3382i(c));
        }
    }

    @Subscribe
    public final void onEvent(DiscardNovelBackup discardNovelBackup) {
        MutabilityOwnership.m3745m(discardNovelBackup, "event");
        PixivAnalytics eVar = this.f18757A;
        MutabilityOwnership.m3746l(eVar, "pixivAnalytics");
        eVar.m6527c(3, AnalyticsAction.UPLOAD_NOVEL_DID_NOT_RESTORE_VIA_UPLOAD, null);
        C3386c Z0 = m4526Z0();
        Z0.f15752c.m12057a();
        Z0.f15753d.mo2437b(NovelBackupAction.C3378e.f15742a);
    }
}
